project(klogging)
cmake_minimum_required(VERSION 3.16)

option(KLOGGING_SUPPORT_LUA "klogging support lua" OFF)

add_library(klogging SHARED
        src/klogging.cpp
)

target_include_directories(klogging
PUBLIC
        include
)
set_target_properties(klogging PROPERTIES
        PUBLIC_HEADER include/klogging.h
)

if(KLOGGING_SUPPORT_LUA)
        target_compile_definitions(klogging
        PRIVATE
                -DKLOGGING_SUPPORT_LUA
        )
        target_link_libraries(klogging
                lua
        )
endif()

add_executable(myprog
        example/myprog.c
)
target_link_libraries(myprog
        klogging
)

install(TARGETS
        klogging
)
